<template>
  <div id="train-agreement">
    <div id="agreement">
      <div class="inner">
        <div class="title">{{ agreementTitle }}</div>
        <div class="content">
          <div v-for="(item, index) in contentList" :class="['items', indexList.includes(index) ? 'mt-30' : '']"
            :key="item">
            {{ item }}
          </div>
        </div>
        <div class="party">
          <div class="party-a">
            <div class="ft">
              <span>甲方：方田教育</span>
            </div>
            <div class="date">
              <span>日期：</span>
              <span> {{ resumeInfo.currentDay }}</span>
            </div>
            <img src="@/assets/img/seal.png" alt="" srcset="" />
          </div>
          <div class="party-b">
            <div class="ft">
              <div class="sign">
                <span>乙方：</span>
                <!-- v-show="!signature" -->
                <img :src="signature" class="sign-img" alt="" />
              </div>
            </div>
            <div class="date">
              <span>日期：</span>
              <span> {{ resumeInfo.agreementTime }}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <ElBacktop :bottom="100" :right="200" target="#agreement" class="back-top">
    <img src="@/assets/img/join/toTop.png" alt="" srcset="" />
  </ElBacktop>
</template>

<script setup lang="ts">
import Agreement from '@/components/Agreement.vue';
import apis from "../../api/index";
const { uploadSignAgreement } = apis;
import { useStore } from '@/store';
import { ElBacktop } from 'element-plus';
import { message } from 'ant-design-vue';
const router = useRouter()
const store = useStore();
const { resumeInfo } = store as any
const salary = ref<string | number>('10');
const internshipSalary = ref<string | number>('100'); //实习期
const probationPeriodSalary = ref<string | number>('200'); //试用期
const regularSalary = ref<string | number>(300); //正式工
const lessonFee = ref<string | number>(122);
const date = ref<string[]>(['2024', '10', '01']);
const contentList = ref<string[]>([
  `尊敬的${resumeInfo.userName}同学：`,
  `您好！`,
  `我们很开心通知您通过了方田教育的培训考核，正式进入三方签约环节，为了明确您的签约意向，我们向您发送此确认书。以下是签约意向的具体内容：`,
  `1. 职位及职责：您将担任教师岗，主要负责教学工工作。`,
  `2. 薪资结构：乙方入职甲方，转正后首年年综合收入原则上不低于人民币${salary.value}万元/年。乙方入职后的薪酬结构原则上为岗位工资+课时费+综合福利。其中，乙方实习期岗位工资标准为人民币${internshipSalary.value}元/天，试用期岗位工资标准为人民币${probationPeriodSalary.value}元/月，转正后岗位工资标准为人民币${regularSalary.value}元/月。课时费标准为${lessonFee.value}元/课起，具体课时费将根据乙方每月实际课时数量和考核结果计算并发放。`,
  '3. 三方协议：我们将与您签订应届生三方协议，确保您的学业和实习安排符合学校规定，同时满足公司的人才需求。',
  '为了确认您的签约意向，请您在收到本确认书后三个工作日内回复，并按照以下指示操作：',
  `- 如果您接受我们的工作邀请并愿意签订三方协议，请签署本确认书的副本，并将其返回给我们，我们将在${date.value[0]}年${date.value[1]}月${date.value[2]}日主动联系您沟通签约细节。`,
  `- 如果您在三个工作日之内未给出明确答复，则视为放弃此份offer，公司将不再为您保留此岗位。 请注意，本确认书的签署并不代表最终的就业合同，所有条款将在正式的三方协议中详细列明。 我们期待您的积极回应，并希望能够与您一起开启美好的职业旅程。`,
  `  此致`,
  `敬礼`,
]);
const agreementTitle = ref<string>('应届生三方协议签约意向确认书');
const indexList = ref<number[]>([3, 6, 7, 9, 11, 13]);
const signature = ref<string>('');
signature.value = resumeInfo.agreementUrl;
</script>

<style lang="scss" scoped>
#agreement {
  width: 100vw;
  height: calc(100vh - 72px);
  margin-top: 72px;
  overflow: auto;
  box-sizing: border-box;
  color: #333;
  padding-top: 20px;
  box-sizing: border-box;
  overflow: auto;

  .inner {
    padding: 40px;
    box-sizing: border-box;
    width: 1200px;
    background: #fff;
    margin: 0 auto;
    border-radius: 12px;
    position: relative;
    min-height: 85vh;
  }
}

.title {
  width: 100%;
  height: 40px;
  opacity: 1;
  font-size: 18px;
  font-weight: normal;
  line-height: 25px;
  text-align: center;
  letter-spacing: 0em;
  font-variation-settings: 'opsz' auto;
  color: #212121;
}

.content {
  .items {
    margin-top: 5px;
  }
}

.mt-30 {
  margin-top: 30px !important;
}

.btn-area {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;

  .btns {
    line-height: 40px;
    text-align: center;
    color: #fff;
    width: 120px;
    height: 40px;
    background: #209ee4;
    border-radius: 8px;
    cursor: pointer;

    &:nth-child(1) {
      margin-right: 20px;
      color: #f56c56;
      background: #f5f7fb;
      border: 1px solid #b3c0c8;
    }
  }
}

.back {
  position: absolute;
  top: 30px;
  left: 30px;
  display: flex;
  color: #333;
  font-size: 16px;
  display: flex;
  align-items: center;

  span {
    margin-left: 10px;
  }
}

.sign {
  display: flex;
  height: 70px;
  align-items: center;

  .start-sign {
    // color: #409eff;
    width: 173px;
    height: 30px;
    background: #f4f6f8;
    border-radius: 5px;
  }

  .sign-img {
    margin-left: 20px;
    width: 130px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
}

.party {
  display: flex;
  justify-content: space-between;
}

.party-a {
  // margin: 24px 0;
  margin-top: 24px;
  line-height: 26px;
  position: relative;

  img {
    width: 70px;
    position: absolute;
    left: 55%;
    top: -10%;
  }
}

.date {
  span {
    &:nth-child(2n) {
      text-decoration: underline;
      margin: 0 5px;
    }
  }
}

.sub-btn {
  border-radius: 5px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  margin: 0 auto;
  margin-bottom: 10px;
  margin-top: 20px;
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);

  span {
    font-size: 14px !important;
  }
}

.back-top {
  img {
    width: 40px;
    height: 40px;
  }
}

.esign {
  position: relative;
  z-index: 100;
  background: #f5f7fb !important;
}
</style>
